import { Component, OnInit } from '@angular/core';
import {ServiceLogicService} from '../../service/service-logic.service';
import {ActivatedRoute} from '@angular/router';
import {BasicInformation} from '../../domain/admin';

@Component({
  selector: 'app-valid-leave-application',
  templateUrl: './valid-leave-application.component.html',
  styleUrls: ['./valid-leave-application.component.css']
})
export class ValidLeaveApplicationComponent implements OnInit {
  private data: any;
  cols: any[];
  basicInformation: BasicInformation;
  constructor(private activateRoute: ActivatedRoute, private logicService: ServiceLogicService) { }

  ngOnInit() {
    this.activateRoute.queryParams.subscribe(params => {
      this.data = params;
    });
    this.logicService.getBasicInformation(this.data.admin_id).then(res => {this.basicInformation = res;
    console.log(this.basicInformation); });
    this.cols = [
      {field: 'compassionate_leave', header: 'compassionate_leave'},
      {field: 'sick_leave', header: 'sick_leave'},
      {field: 'marriage_leave', header: 'marriage_leave'},
      {field: 'maternity_leave', header: 'maternity_leave'},
      {field: 'annual_leave', header: 'annual_leave'}
    ];
  }

}
